package exp.algorithm;

import timeseriesweka.classifiers.AbstractClassifierWithTrainingData;
import timeseriesweka.classifiers.TSF;

import java.io.Serializable;

import org.nd4j.linalg.api.ops.impl.transforms.SoftMax;
import org.slf4j.Logger;

import exp.algorithm.sic.PeakFinderType;
import exp.algorithm.sic.SiftConverter;
import exp.algorithm.sic.VectorMakerType;
import weka.classifiers.bayes.NaiveBayes;
import weka.classifiers.functions.SMO;
import weka.core.Instance;
import weka.core.Instances;
import weka.core.TechnicalInformation;
import utilities.SaveParameterInfo;
import utilities.TrainAccuracyEstimate;
import utilities.ClassifierResults;

/**
 * @author Alex
 *
 */
public class SiftBasedClassifiers extends AbstractClassifierWithTrainingData
		implements SaveParameterInfo, TrainAccuracyEstimate ,Serializable{
	private static final long serialVersionUID = 5895654647529660601L;
	Logger log = org.slf4j.LoggerFactory.getLogger(SiftBasedClassifiers.class);
	SMO nb = new SMO();

	public SiftBasedClassifiers() {

	}

	@Override
	public void writeCVTrainToFile(String train) {
	}

	@Override
	public boolean findsTrainAccuracyEstimate() {
		return false;
	}

	@Override
	public ClassifierResults getTrainResults() {
		return trainResults;
	}

	@Override
	public String getParameters() {
		return super.getParameters() ;
	}

	public TechnicalInformation getTechnicalInformation() {
		TechnicalInformation result;
		result = new TechnicalInformation(TechnicalInformation.Type.ARTICLE);
		return result;
	}

	SiftConverter sc = new SiftConverter(PeakFinderType.DENSE,VectorMakerType.SHAPE);
	@Override
	public void buildClassifier(Instances data) throws Exception {
		Instances transforemd = sc.transform(data);
		nb.buildClassifier(transforemd);
	}

	@Override
	public double[] distributionForInstance(Instance ins) throws Exception {
		Instance in = sc.transform(ins);
		return nb.distributionForInstance(in);
	}

}
